package com.hand.cloud.controller;

import com.hand.cloud.entity.Course;
import com.hand.cloud.domain.mapper.CourseMapper;
import com.hand.cloud.result.Result;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;
import java.util.List;

@RestController
@RequestMapping("/hand")
public class CourseController {
    @Resource
    private CourseMapper courseMapper;

    @GetMapping("/course/all")
    public Result<List<Course>> courseAll() {
        List<Course> courses = courseMapper.selectAll();
        return Result.ok(courses);
    }
}
